
/*
'===============================================================================
'  MP.LayerHelper.MP_OBS.BL.MbLogPageManager
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using MP.LayerHelper.MP_OBS.BLL;
using MP.LayerHelper.MP_OBS.DAL;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.DAL.FactoryClasses;
using MP.LayerHelper.MP_OBS.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using MP.Core.Library;
namespace MP.LayerHelper.MP_OBS.BLL
{
	public class MbLogPageManager : MbLogPageManagerBase
	{
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		public MbLogPageManager()
		{
			// Nothing for now.
		}
		
		/// <summary>
		/// Method to create an instance of MbLogPageManager
		/// </summary>
		/// <returns>An instant of MbLogPageManager class</returns>
		public static MbLogPageManager CreateInstant()
		{
			return new MbLogPageManager();
		}

        public DataTable GetLogByDate(DateTime date, Guid branchId)
        {
            string strSQL = "PRC_LogsByDate";
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@date", date);
            param[1] = new SqlParameter("@branchId", branchId);
            return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringOBS, CommandType.StoredProcedure, strSQL, param);
        }

        public DataTable GetLogViews(Guid PageId, DateTime date)
        {
            string strSQL = "PRC_LogsView";
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@PageId", PageId);
            param[1] = new SqlParameter("@Date", date);
            return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringOBS, CommandType.StoredProcedure, strSQL, param);
        }

        public DataTable GetLogViewDetail(Guid LogPageId)
        {
            string strSQL = "PRC_LogsViewDetail";
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter("@LogPageId", LogPageId);
            return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringOBS, CommandType.StoredProcedure, strSQL, param);
        }

        public DataTable GetLogsTotalByModule(string ModuleId, DateTime frDate, DateTime toDate)
        {
            string strSQL = "PRC_LogsTotalByModule";
            SqlParameter[] param = new SqlParameter[3];
            param[0] = new SqlParameter("@ModuleId", ModuleId);
            param[1] = new SqlParameter("@FromDate", frDate);
            param[2] = new SqlParameter("@ToDate", toDate);
            return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringOBS, CommandType.StoredProcedure, strSQL, param);
        }

        public DataTable GetLogsTotalByModuleChart(DateTime frDate, DateTime toDate)
        {
            string strSQL = "PRC_LogsTotalByModuleChart";
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@FromDate", frDate);
            param[1] = new SqlParameter("@ToDate", toDate);
            return SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringOBS, CommandType.StoredProcedure, strSQL, param);
        }
	}
}
